ALMaSS  1.0
The Animal, Landscape and Man Simulation System
THare_Population_Manager Class Reference

The class that handles all the population lists for hares. More...

#include <hare_all.h>

Inheritance diagram for THare_Population_Manager:
Population_Manager

Public Member Functions

 THare_Population_Manager (Landscape *L)
 This is the constructor for the hare population manager. More...
 
virtual ~THare_Population_Manager (void)
 THare_Population_Manager destructor. More...
 
virtual void TheAOROutputProbe ()
 Output method. More...
 
void CreateObjects (int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
 Method used to create new hares. More...
 
double GetRMR (int a_age, double a_size)
 Returns the RMR given a specific age and mass. More...
 
int GetHareRefNum ()
 Get the next ID number available. More...
 
double GetMaxDailyGrowthEnergy (int a_age)
 
double GetMaxDailyGrowthEnergyP (int a_age)
 Get the maximum daily energy needed for growth for this a_age for use in protein construction. More...
 
double GetMaxDailyGrowthEnergyF (int a_age)
 Get the maximum daily energy needed for growth for this a_age for use in fat construction. More...
 
double GetGrowthEfficiency (int a_age)
 Get the growth efficiency for this a_age. More...
 
double GetGrowthEfficiencyP (int a_age)
 Get the growth efficiency for this a_age for creating protein. More...
 
double GetGrowthEfficiencyF (int a_age)
 Get the growth efficiency for this a_age for creating fat. More...
 
double GetKJperM (int a_size)
 Get the cost of moving 1m in KJ dependent upon mass (. More...
 
int GetLitterSize (int noLitters)
 Returns the litter size. More...
 
void AddHareDensity (int x, int y, Hare_Object a_type)
 Density function - adds one to the density in the square containing by x,y. Each square is 256x256m in size. More...
 
void SubtractHareDensity (int x, int y, Hare_Object a_type)
 Density function - subtracts one from the density in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetInfantDensity (int x, int y)
 Density function - returns the density of infants in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetYoungDensity (int x, int y)
 Density function - returns the density of young in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetJuvenileDensity (int x, int y)
 Density function - returns the density of juveniles in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetMaleDensity (int x, int y)
 Density function - returns the density of males in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetFemaleDensity (int x, int y)
 Density function - returns the density of females in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetTotalDensity (int x, int y)
 Density function - returns the density of all hares in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetAdultDensity (int x, int y)
 Density function - returns the density of adults in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetDelayedAdultDensity (int x, int y)
 Density function - returns the density of adults in the square containing by x,y, but for last year at this time. Each square is 256x256m in size. More...
 
double GetInterference (int h)
 Return the proportion of time used in communicating with con-specifics. More...
 
double GetPolyFood (int a_poly)
 Get stored polygon food quality. More...
 
void SetPolyFood (int a_poly, double a_value)
 Set polygon food quality. More...
 
void BodyBurdenOut (int a_year, int a_day, double a_bb, double a_mgkg)
 BodyBurden output. More...
 
- Public Member Functions inherited from Population_Manager
 Population_Manager (Landscape *L)
 
virtual ~Population_Manager (void)
 
void SetNoProbes (int a_pn)
 
unsigned GetLiveArraySize (int a_listindex)
 Gets the number of 'live' objects for a list index in the TheArray. More...
 
void IncLiveArraySize (int a_listindex)
 Increments the number of 'live' objects for a list index in the TheArray. More...
 
virtual void Catastrophe (int)
 
unsigned int FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal)
 
char * SpeciesSpecificReporting (int a_species, int a_time)
 
char * ProbeReport (int a_time)
 
char * ProbeReportTimed (int a_time)
 
void ImpactProbeReport (int a_Time)
 
bool BeginningOfMonth ()
 
void LOG (const char *fname)
 
int SupplyStepSize ()
 
int SupplySimW ()
 
int SupplySimH ()
 
virtual void Run (int NoTSteps)
 
virtual float Probe (int ListIndex, probe_data *p_TheProbe)
 
virtual void ImpactedProbe ()
 
int SupplyListNameLength ()
 
TAnimalSupplyAnimalPtr (int a_index, int a_animal)
 Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More...
 
unsigned SupplyListIndexSize ()
 
unsigned SupplyListSize (unsigned listindex)
 
bool CheckXY (int l, int i)
 Debug method to test for out of bounds coordinates. More...
 
const char * SupplyListName (int i)
 
bool IsLast (unsigned listindex)
 
int SupplyState (unsigned listindex, unsigned j)
 
virtual void SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y)
 
const char * SupplyStateNames (int i)
 
unsigned SupplyStateNamesLength ()
 
virtual void DisplayLocations ()
 
int ProbeFileInput (char *p_Filename, int p_ProbeNo)
 
TAnimalFindClosest (int x, int y, unsigned Type)
 
bool OpenTheRipleysOutputProbe (string a_NWordFilename)
 
void OpenTheAOROutputProbe (string a_AORFilename)
 
bool OpenTheMonthlyRipleysOutputProbe ()
 
bool OpenTheReallyBigProbe ()
 
virtual void TheReallyBigOutputProbe ()
 
void CloseTheMonthlyRipleysOutputProbe ()
 
virtual void CloseTheRipleysOutputProbe ()
 
virtual void CloseTheReallyBigOutputProbe ()
 
TTypesOfPopulation GetPopulationType ()
 
int GetSeasonNumber ()
 Get the season number. More...
 
void LamdaDeath (int x, int y)
 
void LamdaBirth (int x, int y)
 
void LamdaBirth (int x, int y, int z)
 
void LamdaClear ()
 
void LamdaDumpOutput ()
 
virtual int SupplyPegPosx (int)
 
virtual int SupplyPegPosy (int)
 
virtual int SupplyCovPosx (int)
 
virtual int SupplyCovPosy (int)
 
virtual bool OpenTheFledgelingProbe ()
 
virtual bool OpenTheBreedingPairsProbe ()
 
virtual bool OpenTheBreedingSuccessProbe ()
 
virtual void BreedingPairsOutput (int)
 
virtual int TheBreedingFemalesProbe (int)
 
virtual int TheFledgelingProbe ()
 
virtual void BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int)
 
virtual int TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &)
 
virtual void FledgelingProbeOutput (int, int)
 
virtual void TheGeneticProbe (unsigned, int, unsigned &)
 
virtual void GeneticsResultsOutput (FILE *, unsigned)
 

Public Attributes

double m_JuvMortRate
 Input variable - Juvenile mortality rate. More...
 
double m_AdultMortRate
 Input variable - Adult mortality rate. More...
 
double m_YoungMortRate
 Input variable - Young mortality rate. More...
 
float m_GoodYearBadYear
 Variable for adding stochasticity. More...
 
double m_DMWeight [5001]
 Array for storing minimum acceptable size with age. More...
 
int m_HareThresholdDD
 Input variable - Threshold density dependence level. More...
 
- Public Attributes inherited from Population_Manager
int IndexArrayX [5][10000]
 
probe_dataTheProbe [100]
 
int SimH
 
int SimW
 
unsigned SimHH
 
unsigned SimWH
 
char m_SimulationName [255]
 
bool ProbesSet
 
Landscapem_TheLandscape
 

Protected Member Functions

void Init ()
 Sets up data structures and calculations prior to starting simulation. More...
 
void CalcLitterSize (double mean, double SD, int litter)
 
virtual void DoFirst ()
 The first method called of the new time-step. More...
 
virtual void DoLast ()
 The last method called before the new time-step starts. More...
 
virtual void DoAlmostLast ()
 Called before clean-up of dead objects. More...
 
void POMOutputs ()
 This method is called to dump the information needed for POM approaches. More...
 
void MRROutputs ()
 Special probe for data to be used in mark-release-recapture simulations. More...
 
virtual void TheRipleysOutputProbe (FILE *a_prb)
 Standard spatial output. More...
 
void ExtraPopMort (void)
 An extra global mortality
More...
 
void Hunting (void)
 
void HuntingGrid (void)
 
void HuntingDifferentiatedBeetleBankArea (void)
 
virtual void Catastrophe ()
 Annual global change in population numbers. More...
 
- Protected Member Functions inherited from Population_Manager
virtual bool StepFinished ()
 Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More...
 
virtual void DoBefore ()
 
virtual void DoAfter ()
 
void EmptyTheArray ()
 Removes all objects from the TheArray by deleting them and clearing TheArray. More...
 
void SortX (unsigned Type)
 
void SortXIndex (unsigned Type)
 
void SortY (unsigned Type)
 
void SortState (unsigned Type)
 
void SortStateR (unsigned Type)
 
unsigned PartitionLiveDead (unsigned Type)
 
void Shuffle_or_Sort (unsigned Type)
 
void Shuffle (unsigned Type)
 

Protected Attributes

int m_RefNums
 The last hare ID used
More...
 
int m_shot
 Hunting Bag. More...
 
double m_MortStochast
 Stochasticity around mortality parameters
More...
 
double m_Interference [2500]
 Array storing density-dependence effect with density
More...
 
int m_DensityMap [8][200][200]
 Array storing densities measured in different ways
More...
 
int m_variableDD
 Used to vary the density dependence each year
More...
 
int m_LitterSize [12][7]
 Storage for litter size distributions (not used in default config)
More...
 
double * m_PolyFood
 Temporary storage
More...
 
double m_RMR [2][366]
 Precalculated RMR with age
More...
 
double m_MaxDailyGrowthEnergy [5001]
 Precalculated max growth energy requirement with size
More...
 
double m_GrowthEfficiency [5001]
 Precalculated growth efficiency with size
More...
 
double m_MaxDailyGrowthEnergyP [5001]
 Precalculated max growth energy requirement with size for protein
More...
 
double m_MaxDailyGrowthEnergyF [5001]
 Precalculated max growth energy requirement with size for fat
More...
 
double m_GrowthEfficiencyP [5001]
 Precalculated growth efficiency for protein with size
More...
 
double m_GrowthEfficiencyF [5001]
 Precalculated growth efficiency for fat with size
More...
 
double m_KJperM [7001]
 Precalculated cost of locomotion - KJ per m per kg
More...
 
MRR_Datam_OurMRRData
 Data structure for MarkReleaseRecapture expts
More...
 
FILE * BodyBurdenPrb
 
- Protected Attributes inherited from Population_Manager
vector< unsigned > m_LiveArraySize
 
int m_NoProbes
 
AOR_Probem_AOR_Probe
 
FILE * m_GeneticsFile
 
FILE * m_AlleleFreqsFile
 
FILE * m_EasyPopRes
 
const char * StateNames [100]
 
int m_catastrophestartyear
 
int m_StepSize
 
vector< TListOfAnimalsTheArray
 
unsigned StateNamesLength
 
const char * m_ListNames [32]
 
unsigned m_ListNameLength
 
FILE * TestFile
 
FILE * TestFile2
 
unsigned BeforeStepActions [12]
 
int m_SeasonNumber
 Holds the season number. Used when running goose and hunter sims. More...
 
TTypesOfPopulation m_population_type
 
ofstream * AOROutputPrb
 
FILE * RipleysOutputPrb
 
FILE * RipleysOutputPrb1
 
FILE * RipleysOutputPrb2
 
FILE * RipleysOutputPrb3
 
FILE * RipleysOutputPrb4
 
FILE * RipleysOutputPrb5
 
FILE * RipleysOutputPrb6
 
FILE * RipleysOutputPrb7
 
FILE * RipleysOutputPrb8
 
FILE * RipleysOutputPrb9
 
FILE * RipleysOutputPrb10
 
FILE * RipleysOutputPrb11
 
FILE * RipleysOutputPrb12
 
FILE * ReallyBigOutputPrb
 
long int lamdagrid [2][257][257]
 

Detailed Description

The class that handles all the population lists for hares.

Constructor & Destructor Documentation

◆ THare_Population_Manager()

THare_Population_Manager::THare_Population_Manager ( Landscape L)

This is the constructor for the hare population manager.

It simply dumps unnecessary lists from the main population record (TheArray), then calls Init which initialises the variables needed before running.

384  : Population_Manager(L)
385 {
386  for (int i=0; i<5; i++)
387  {
388  TheArray.pop_back();
389  }
390  Init();
391 }
Population_Manager(Landscape *L)
Definition: PopulationManager.cpp:221
vector< TListOfAnimals > TheArray
Definition: PopulationManager.h:534
void Init()
Sets up data structures and calculations prior to starting simulation.
Definition: Hare_all.cpp:402

References Init(), and Population_Manager::TheArray.

◆ ~THare_Population_Manager()

THare_Population_Manager::~THare_Population_Manager ( void  )
virtual

THare_Population_Manager destructor.

367 {
369  fclose(BodyBurdenPrb);
370  free(m_PolyFood);
371  delete m_OurMRRData;
372 }
MRR_Data * m_OurMRRData
Data structure for MarkReleaseRecapture expts
Definition: hare_all.h:788
FILE * BodyBurdenPrb
Definition: hare_all.h:790
double * m_PolyFood
Temporary storage
Definition: hare_all.h:768
static double * m_vegPalatability
Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetatio...
Definition: hare_all.h:318

References BodyBurdenPrb, m_OurMRRData, m_PolyFood, and THare::m_vegPalatability.

Member Function Documentation

◆ AddHareDensity()

void THare_Population_Manager::AddHareDensity ( int  x,
int  y,
Hare_Object  a_type 
)
inline

Density function - adds one to the density in the square containing by x,y. Each square is 256x256m in size.

641 { m_DensityMap[a_type][x >> __DENSITYSHIFT][y >> __DENSITYSHIFT]++; }
int m_DensityMap[8][200][200]
Array storing densities measured in different ways
Definition: hare_all.h:762

References m_DensityMap.

Referenced by DoFirst(), and Hare_Juvenile::st_Dispersal().

◆ BodyBurdenOut()

void THare_Population_Manager::BodyBurdenOut ( int  a_year,
int  a_day,
double  a_bb,
double  a_mgkg 
)
inline

BodyBurden output.

723  {
724  fprintf(BodyBurdenPrb, "%d\t%d\t%g\t%g\n", a_year, a_day, a_bb, a_mgkg);
725  }

References BodyBurdenPrb.

Referenced by Hare_Male::InternalPesticideHandlingAndResponse(), and Hare_Female::InternalPesticideHandlingAndResponse().

◆ CalcLitterSize()

void THare_Population_Manager::CalcLitterSize ( double  mean,
double  SD,
int  litter 
)
protected

Calculates probabilities out of 10000 that a litter of a certain size is obtained.
Assumes a normal distribution around mean and SD. NB - will give problems if the SD==0.0

710 {
714  double P;
715  double Distribution[7];
716  double total=0;
717  // Max 6 leverets
718  if (mean<=0) {
719  for (int i=0; i<7; i++) {
720  m_LitterSize[index][i]=10000;
721  }
722  } else {
723  // (from Zar page 79).
724  for (int i=0; i<7; i++) {
725  P=(1.0/SD*sqrt(2*3.14159265) );
726  P*=exp(-1*(((i-mean)*(i-mean))/(2*SD*SD)));
727  Distribution[i]=P;
728  total+=P;
729  }
730  int last=0;
731  for (int i=0; i<7; i++) {
732  m_LitterSize[index][i]=(int)(floor(0.5+((Distribution[i]/total)*10000)+last));
733  last=m_LitterSize[index][i];
734  }
735  }
736 }
int m_LitterSize[12][7]
Storage for litter size distributions (not used in default config)
Definition: hare_all.h:766

References m_LitterSize.

Referenced by Init().

◆ Catastrophe()

void THare_Population_Manager::Catastrophe ( void  )
protectedvirtual

Annual global change in population numbers.

Remove or add hares to the population on a certain day and year - used for theoretical scenarios & testing

Reimplemented from Population_Manager.

4046  {
4047  // First do we have the right day?
4048  int today = m_TheLandscape->SupplyDayInYear();
4049  if (today!=1) return;
4050  // First do we have the right year?
4052  if (year%cfg_pm_eventfrequency.value()!=0) return;
4053 
4054  THare* AH = NULL;
4055  // Now if the % decrease is higher or lower than 100 we need to do different things
4056  int esize=cfg_pm_eventsize.value();
4057  if (esize<100) {
4058  unsigned size2;
4059  size2 = GetLiveArraySize(hob_Juvenile);
4060  for ( unsigned j = 0; j < size2; j++ ) {
4061  if (random(100) > esize) {
4062  AH = dynamic_cast < THare * > ( TheArray[hob_Juvenile] [ j ] );
4063  AH->Dying(); // Kill it
4064  }
4065  }
4066  size2 = GetLiveArraySize(hob_Female);
4067  for ( unsigned j = 0; j < size2; j++ ) {
4068  if (random(100) > esize) {
4069  AH = dynamic_cast < THare * > ( TheArray[hob_Female] [ j ] );
4070  AH->Dying(); // Kill it
4071  }
4072  }
4073  size2 = GetLiveArraySize(hob_Male);
4074  for ( unsigned j = 0; j < size2; j++ ) {
4075  if (random(100) > esize) {
4076  AH = dynamic_cast < THare * > ( TheArray[hob_Male] [ j ] );
4077  AH->Dying(); // Kill it
4078  }
4079  }
4080  }
4081  else if (esize>100) {
4082 /*
4083  Not implemented or needed as of yet
4084 */
4085  }
4086  else return; // No change so do nothing
4087 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
CfgInt cfg_pm_eventsize
CfgInt cfg_pm_eventfrequency
int value(void)
Definition: configurator.h:98
int SupplyYearNumber(void)
Definition: landscape.h:1616
int SupplyDayInYear(void)
Definition: landscape.h:1596
int m_catastrophestartyear
Definition: PopulationManager.h:532
unsigned GetLiveArraySize(int a_listindex)
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:433
Landscape * m_TheLandscape
Definition: PopulationManager.h:515
virtual void Dying()
Definition: PopulationManager.h:266
The base class for all hare classes.
Definition: hare_all.h:155
@ hob_Male
Definition: hare_all.h:60
@ hob_Female
Definition: hare_all.h:61
@ hob_Juvenile
Definition: hare_all.h:59

References cfg_pm_eventfrequency, cfg_pm_eventsize, TAnimal::Dying(), Population_Manager::GetLiveArraySize(), hob_Female, hob_Juvenile, hob_Male, Population_Manager::m_catastrophestartyear, Population_Manager::m_TheLandscape, random(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, and CfgInt::value().

◆ CreateObjects()

void THare_Population_Manager::CreateObjects ( int  ob_type,
TAnimal pvo,
void *  null,
struct_Hare data,
int  number 
)

Method used to create new hares.

Creates new hare objects that have just been born, or because of changes of life-stage require the creation of a new object. Input data is passed in the struct_Hare
This is a very important method - each type of population manager has its own implementation. This is the method that must be called every time a new Hare object is created.

930 {
931  Hare_Infant* new_Infant;
932  Hare_Young* new_Young;
933  Hare_Juvenile* new_Juvenile;
934  Hare_Female* new_Female;
935  Hare_Female* Mum;
936  Hare_Male* new_Male;
937  for (int i = 0; i < number; i++)
938  {
939  if (unsigned(TheArray[ob_type].size()) > GetLiveArraySize(ob_type)) {
940  // We need to reuse an object
941  if (ob_type == 0) // Infant
942  {
943  new_Infant = dynamic_cast<Hare_Infant*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
944  new_Infant->ReInit((*data));
945  Mum = dynamic_cast<Hare_Female*>(pvo);
946  if (Mum) new_Infant->SetMum(Mum);
947  new_Infant->SetWeight(data->weight);
948  if (Mum) Mum->AddYoung(new_Infant);
949  }
950  if (ob_type == 1) // Young
951  {
952  new_Young = dynamic_cast<Hare_Young*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
953  new_Young->ReInit((*data));
954  new_Young->SetMum(data->Mum); // NB Mum may be NULL - this is OK
955  THare* old_Young = (THare*)pvo;
956  if (data->Mum) {
957  data->Mum->UpdateYoung(old_Young, new_Young);
958  }
959  }
960  if (ob_type == 2) // Juvenile
961  {
962  new_Juvenile = dynamic_cast<Hare_Juvenile*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
963  new_Juvenile->ReInit((*data));
964  new_Juvenile->SetMum(NULL);
965  }
966  if (ob_type == 3) // Male
967  {
968  new_Male = dynamic_cast<Hare_Male*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
969  new_Male->ReInit((*data));
970  }
971  if (ob_type == 4) // Female
972  {
973  new_Female = dynamic_cast<Hare_Female*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
974  new_Female->ReInit((*data));
975  }
976  }
977  else {
978 
979  if (ob_type == 0) // Infant
980  {
981  new_Infant = new Hare_Infant(data->x, data->y, data->L, data->HM);
982  TheArray[ob_type].push_back(new_Infant);
983  Mum = dynamic_cast<Hare_Female*>(pvo);
984  if (Mum) new_Infant->SetMum(Mum);
985  new_Infant->SetWeight(data->weight);
986  if (Mum) Mum->AddYoung(new_Infant);
987  }
988  if (ob_type == 1) // Young
989  {
990  new_Young = new Hare_Young(data->x, data->y, data->L, data->HM,
991  data->weight);
992  new_Young->SetMum(data->Mum); // NB Mum may be NULL - this is OK
993  // *** DeBug ***
994  //new_Young->m_MyOldMum=data->oldMum;
995  THare* old_Young = (THare*)pvo;
996  if (data->Mum) {
997  data->Mum->UpdateYoung(old_Young, new_Young);
998  }
999  TheArray[ob_type].push_back(new_Young);
1000  }
1001  if (ob_type == 2) // Juvenile
1002  {
1003  new_Juvenile = new Hare_Juvenile(data->x, data->y, data->L,
1004  data->HM, data->weight);
1005  new_Juvenile->SetMum(NULL);
1006  // *** DeBug ***
1007  //new_Juvenile->m_MyOldMum=data->oldMum;
1008 
1009  TheArray[ob_type].push_back(new_Juvenile);
1010  }
1011  if (ob_type == 3) // Male
1012  {
1013  new_Male = new Hare_Male(data->x, data->y, data->L, data->HM,
1014  data->weight, data->age, data->RefNum);
1015  TheArray[ob_type].push_back(new_Male);
1016  }
1017  if (ob_type == 4) // Female
1018  {
1019  new_Female = new Hare_Female(data->x, data->y, data->L, data->HM,
1020  data->weight, data->age, data->RefNum);
1021  TheArray[ob_type].push_back(new_Female);
1022  }
1023  }
1024  IncLiveArraySize(ob_type);
1025  }
1026 }
Class for female hares.
Definition: hare_all.h:1041
void AddYoung(THare *a_new)
Add a leveret to the list of kids.
Definition: Hare_all.cpp:3844
bool UpdateYoung(THare *a_old, THare *a_new)
Swap a young list pointer.
Definition: Hare_all.cpp:3823
void ReInit(struct_Hare a_data)
Female object reinitiation.
Definition: Hare_all.cpp:3123
Class for infant hares (stationary, only milk inputs)
Definition: hare_all.h:818
void SetWeight(double w)
Set the weight.
Definition: hare_all.h:851
void ReInit(struct_Hare a_data)
Infant object reinitiation.
Definition: Hare_all.cpp:1276
void SetMum(Hare_Female *a_af)
Set the mother pointer.
Definition: hare_all.h:856
Class for juvenile hares (after 5 weeks old, fully mobile)
Definition: hare_all.h:925
void ReInit(struct_Hare a_data)
Juvenile object reinitiation.
Definition: Hare_all.cpp:2225
Class for male hares.
Definition: hare_all.h:977
void ReInit(struct_Hare a_data)
Male object reinitiation.
Definition: Hare_all.cpp:2675
Class for young hares (low mobility, milk and solid food inputs)
Definition: hare_all.h:873
void ReInit(struct_Hare a_data)
Young object reinitiation.
Definition: Hare_all.cpp:1722
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:437
void SetMum(Hare_Female *)
Set the mother pointer. Reimplemented in Hare_Infant.
Definition: hare_all.h:399
int y
Definition: hare_all.h:138
int x
Definition: hare_all.h:137
Landscape * L
Definition: hare_all.h:140
int RefNum
Definition: hare_all.h:143
double weight
Definition: hare_all.h:144
THare_Population_Manager * HM
Definition: hare_all.h:141
int age
Definition: hare_all.h:139
Hare_Female * Mum
Definition: hare_all.h:142

References Hare_Female::AddYoung(), struct_Hare::age, Population_Manager::GetLiveArraySize(), struct_Hare::HM, Population_Manager::IncLiveArraySize(), struct_Hare::L, struct_Hare::Mum, struct_Hare::RefNum, Hare_Infant::ReInit(), Hare_Young::ReInit(), Hare_Juvenile::ReInit(), Hare_Male::ReInit(), Hare_Female::ReInit(), THare::SetMum(), Hare_Infant::SetMum(), Hare_Infant::SetWeight(), Population_Manager::TheArray, Hare_Female::UpdateYoung(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by Hare_Female::GiveBirth(), Init(), Hare_Infant::st_NextStage(), Hare_Young::st_NextStage(), and Hare_Juvenile::st_NextStage().

◆ DoAlmostLast()

void THare_Population_Manager::DoAlmostLast ( void  )
protectedvirtual

Called before clean-up of dead objects.

In this case this only applies hunting mortality. Needs to be done before objects are tidied up at the end of the time-step.

Reimplemented from Population_Manager.

908 {
910  {
913  else Hunting();
914  }
915 }
CfgInt cfg_HareHuntingDate("HARE_HUNTING_DATE", CFG_CUSTOM, 312)
CfgInt cfg_HareHuntingType("HARE_HUNTING_TYPE", CFG_CUSTOM, 0)
void HuntingGrid(void)
Definition: Hare_all.cpp:4227
void Hunting(void)
Definition: Hare_all.cpp:4131
void HuntingDifferentiatedBeetleBankArea(void)
Definition: Hare_all.cpp:4178

References cfg_HareHuntingDate, cfg_HareHuntingType, Hunting(), HuntingDifferentiatedBeetleBankArea(), HuntingGrid(), Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), and CfgInt::value().

◆ DoFirst()

void THare_Population_Manager::DoFirst ( void  )
protectedvirtual

The first method called of the new time-step.

Does special start of step actions here. In this case optional changes to parameter values e.g. mortality rates, data outputs e.g. POMOutputs(), and clearing the forage food array.

Reimplemented from Population_Manager.

818 {
819 #ifdef __EXTRAPOPMORT
820  ExtraPopMort();
821 #endif
822  if (m_TheLandscape->SupplyDayInYear()==1) {
823 
824 #ifdef __VARIABLEDD
825  m_variableDD=random(21);
826 #endif
827 #ifdef __YEARLYVARIABLEFOODQUALITY
828  m_GoodYearBadYear = (float) (1.0 + float(random(40)-20)/100.0);
829 #endif
830 #ifdef __MORTSTOCHASTICITY
831  double MortStochasticity = ((random(200)/100.0)-1.0)* m_MortStochast; // -1.0 to +1.0 * m_MortStochast
835 #else
839 #endif
840  }
841  //else if (m_TheLandscape->SupplyDayInYear()==(cfg_HareHuntingDate.value()-1)) {
842  AnimalPosition HP;
843  for (unsigned listindex=0; listindex<2;listindex++) {
844  unsigned size = GetLiveArraySize(listindex);
845  for (unsigned j=0; j<size; j++)
846  {
847 
848  HP=TheArray[listindex][j]->SupplyPosition();
849  AddHareDensity(HP.m_x, HP.m_y, (Hare_Object) listindex);
850  }
851  }
852  for (unsigned listindex=2; listindex<TheArray.size();listindex++) {
853  unsigned size= GetLiveArraySize(listindex);
854  for (unsigned j=0; j<size; j++)
855  {
856  HP=TheArray[listindex][j]->SupplyPosition();
857  int x=HP.m_x>>__DENSITYSHIFT;
858  int y=HP.m_y>>__DENSITYSHIFT;
859  m_DensityMap[listindex][x][y]++;
860  m_DensityMap[5][x][y]++;
861  m_DensityMap[7][x][y]++;
862  }
863  }
865  for (int i=0; i<100; i++) {
866  for (int j=0; j<100; j++) {
867  m_DensityMap[6][i][j]=m_DensityMap[7][i][j]/365;
868  m_DensityMap[7][i][j]=0;
869  }
870  }
871  }
872 
873  if (m_TheLandscape->SupplyDayInYear() == (270))
874  {
875  POMOutputs();
876 #ifdef __STERILITY
877  unsigned size = GetLiveArraySize(hob_Female);
878  for (unsigned j = 0; j<size; j++) {
879  Hare_Female* HF;
880  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
881  if (HF->GetAge() < 730) {
882  int test = int(g_rand_uni() * 10000);
883  if (HF->GetAge() < 730) {
884  if (test<cfg_hare_firstyearsterility.value()) HF->SetSterile();
885  }
886  else {
887  if (test<cfg_hare_femalesterility.value()) HF->SetSterile();
888  }
889  }
890  }
891 #endif
892  }
893 
894  // Now do clear the forage food array
895  for (int i=0; i<=m_TheLandscape->SupplyLargestPolyNumUsed(); i++) {
896  m_PolyFood [i]=-1;
897  }
898 }
static CfgFloat cfg_hare_young_predation("HARE_YOUNG_PREDATION", CFG_CUSTOM, 0.002)
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
static CfgInt cfg_hare_firstyearsterility("HARE_FIRSTYEARSTERILITY", CFG_CUSTOM, 769)
CfgFloat cfg_hare_adult_predation("HARE_ADULT_PREDATION", CFG_CUSTOM, 0.0023)
static CfgInt cfg_hare_femalesterility("HARE_FEMALESTERILITY", CFG_CUSTOM, 1401)
static CfgFloat cfg_hare_juvenile_predation("HARE_JUVENILE_PREDATION", CFG_CUSTOM, 0.0016)
A class defining an animals position.
Definition: PopulationManager.h:170
unsigned m_x
Definition: PopulationManager.h:172
unsigned m_y
Definition: PopulationManager.h:173
double value(void)
Definition: configurator.h:118
void SetSterile()
Female is sterile.
Definition: hare_all.h:1093
int SupplyLargestPolyNumUsed()
Definition: landscape.h:355
double m_JuvMortRate
Input variable - Juvenile mortality rate.
Definition: hare_all.h:730
float m_GoodYearBadYear
Variable for adding stochasticity.
Definition: hare_all.h:742
double m_YoungMortRate
Input variable - Young mortality rate.
Definition: hare_all.h:738
void ExtraPopMort(void)
An extra global mortality
Definition: Hare_all.cpp:4093
void AddHareDensity(int x, int y, Hare_Object a_type)
Density function - adds one to the density in the square containing by x,y. Each square is 256x256m i...
Definition: hare_all.h:641
int m_variableDD
Used to vary the density dependence each year
Definition: hare_all.h:764
void POMOutputs()
This method is called to dump the information needed for POM approaches.
Definition: Hare_all.cpp:1073
double m_AdultMortRate
Input variable - Adult mortality rate.
Definition: hare_all.h:734
double m_MortStochast
Stochasticity around mortality parameters
Definition: hare_all.h:758
int GetAge()
Definition: hare_all.h:377
Hare_Object
Definition: hare_all.h:56
const int October
Definition: landscape.h:45

References AddHareDensity(), cfg_hare_adult_predation, cfg_hare_femalesterility, cfg_hare_firstyearsterility, cfg_hare_juvenile_predation, cfg_hare_young_predation, ExtraPopMort(), g_rand_uni, THare::GetAge(), Population_Manager::GetLiveArraySize(), hob_Female, m_AdultMortRate, m_DensityMap, m_GoodYearBadYear, m_JuvMortRate, m_MortStochast, m_PolyFood, Population_Manager::m_TheLandscape, m_variableDD, AnimalPosition::m_x, AnimalPosition::m_y, m_YoungMortRate, October, POMOutputs(), random(), Hare_Female::SetSterile(), Landscape::SupplyDayInYear(), Landscape::SupplyLargestPolyNumUsed(), Population_Manager::TheArray, CfgInt::value(), and CfgFloat::value().

◆ DoLast()

void THare_Population_Manager::DoLast ( void  )
protectedvirtual

The last method called before the new time-step starts.

Called after EndStep and before the landscape turns for the next time-step.
Does special end of step actions here. In this case zeroing the density maps, optional debug and mark-release-recapture outputs

Reimplemented from Population_Manager.

764 {
766 
767 // Do our special end of time step actions here
768  // Clear the old data
769  for (int i=0; i<100; i++) {
770  for (int j=0; j<100; j++) {
771  m_DensityMap[0][i][j]=0;
772  m_DensityMap[1][i][j]=0;
773  m_DensityMap[2][i][j]=0;
774  m_DensityMap[3][i][j]=0;
775  m_DensityMap[4][i][j]=0;
776  m_DensityMap[5][i][j]=0;
777  }
778  }
779 
780  //Special hare debugging test
781  //if (m_TheLandscape->SupplyDayInMonth()==1) {
782  /*
783  if (TheArray[hob_Female].size()>0) {
784  Hare_Female* HF;
785  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][0]);
786  HF->dumpEnergy();
787  }
788  */
789  /*
790  FILE* hareweights=fopen(hareweights,"HareWeights.txt","a");
791  for (unsigned listindex=0; listindex<5; listindex++)
792  {
793  unsigned size=TheArray[listindex].size();
794  if (size>0) {
795  for (unsigned j=0; j<size; j++)
796  {
797  int age=dynamic_cast < THare * > ( TheArray[listindex][j] )->GetAge();
798  double w=dynamic_cast < THare * > ( TheArray[listindex][j] )->GetWeight();
799  int weight=int (floor(0.5+w));
800  fprintf(hareweights,"%i\t%i\n",age, weight);
801  }
802  }
803  }
804  fclose(hareweights);
805  // End special
806 */
807  MRROutputs();
808 }
virtual void DoLast()
Definition: PopulationManager.cpp:530
void MRROutputs()
Special probe for data to be used in mark-release-recapture simulations.
Definition: Hare_all.cpp:1232

References Population_Manager::DoLast(), m_DensityMap, and MRROutputs().

◆ ExtraPopMort()

void THare_Population_Manager::ExtraPopMort ( void  )
protected

An extra global mortality

Like Catastrophe() this just kills hares but always on Jan 1st.
Used for POM testing only.

4093  {
4094  THare* AH = NULL;
4095  // This version simply alters populations on 1st January
4096  int esize= random(50);
4097  // First do we have the right day?
4098  int today = m_TheLandscape->SupplyDayInYear();
4099  if (today!=1) return;
4100  // First do we have the right year?
4101  // First do we have the right year?
4102  int year = m_TheLandscape->SupplyYearNumber();
4103  if (year%1!=0) return;
4104  unsigned size2;
4105  size2 = GetLiveArraySize(hob_Juvenile);
4106  for ( unsigned j = 0; j < size2; j++ ) {
4107  if (random(100) < esize) {
4108  AH = dynamic_cast < THare * > ( TheArray[hob_Juvenile] [ j ] );
4109  AH->Dying(); // Kill it
4110  }
4111  }
4112  size2 = GetLiveArraySize(hob_Male);
4113  for ( unsigned j = 0; j < size2; j++ ) {
4114  if (random(100) < esize) {
4115  AH = dynamic_cast < THare * > ( TheArray[hob_Male] [ j ] );
4116  AH->Dying(); // Kill it
4117  }
4118  }
4119  size2 = GetLiveArraySize(hob_Female);
4120  for ( unsigned j = 0; j < size2; j++ ) {
4121  if (random(100) < esize) {
4122  AH = dynamic_cast < THare * > ( TheArray[hob_Female] [ j ] );
4123  AH->Dying(); // Kill it
4124  }
4125  }
4126 }

References TAnimal::Dying(), Population_Manager::GetLiveArraySize(), hob_Female, hob_Juvenile, hob_Male, Population_Manager::m_TheLandscape, random(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and Population_Manager::TheArray.

Referenced by DoFirst().

◆ GetAdultDensity()

int THare_Population_Manager::GetAdultDensity ( int  x,
int  y 
)
inline

Density function - returns the density of adults in the square containing by x,y. Each square is 256x256m in size.

682  {
683  return (m_DensityMap[hob_Male][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT] + m_DensityMap[hob_Female][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]);
684  }

References hob_Female, hob_Male, and m_DensityMap.

Referenced by Hare_Juvenile::st_Dispersal(), Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ GetDelayedAdultDensity()

int THare_Population_Manager::GetDelayedAdultDensity ( int  x,
int  y 
)
inline

Density function - returns the density of adults in the square containing by x,y, but for last year at this time. Each square is 256x256m in size.

689  {
690  return m_DensityMap[6][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT];
691  }

References m_DensityMap.

Referenced by Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ GetFemaleDensity()

int THare_Population_Manager::GetFemaleDensity ( int  x,
int  y 
)
inline

Density function - returns the density of females in the square containing by x,y. Each square is 256x256m in size.

671 { return m_DensityMap[hob_Female][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Female, and m_DensityMap.

◆ GetGrowthEfficiency()

double THare_Population_Manager::GetGrowthEfficiency ( int  a_age)
inline

Get the growth efficiency for this a_age.

590  {
591 #ifdef __BOUNDSCHECK
592  if ((a_age<0) || (a_age>5000)) {
593  m_TheLandscape->Warn( "Hare GetGrowthEfficiency a_age out of bounds", NULL );
594  exit( 1 );
595  }
596 #endif
597  return m_GrowthEfficiency[a_age]; }
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
double m_GrowthEfficiency[5001]
Precalculated growth efficiency with size
Definition: hare_all.h:776

References m_GrowthEfficiency, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::st_Developing().

◆ GetGrowthEfficiencyF()

double THare_Population_Manager::GetGrowthEfficiencyF ( int  a_age)
inline

Get the growth efficiency for this a_age for creating fat.

614  {
615 #ifdef __BOUNDSCHECK
616  if ((a_age<0) || (a_age>5000)) {
617  m_TheLandscape->Warn( "Hare m_GrowthEfficiencyF a_age out of bounds", NULL );
618  exit( 1 );
619  }
620 #endif
621  return m_GrowthEfficiencyF[a_age]; }
double m_GrowthEfficiencyF[5001]
Precalculated growth efficiency for fat with size
Definition: hare_all.h:784

References m_GrowthEfficiencyF, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetGrowthEfficiencyP()

double THare_Population_Manager::GetGrowthEfficiencyP ( int  a_age)
inline

Get the growth efficiency for this a_age for creating protein.

602  {
603 #ifdef __BOUNDSCHECK
604  if ((a_age<0) || (a_age>5000)) {
605  m_TheLandscape->Warn( "Hare GetGrowthEfficiencyP a_age out of bounds", NULL );
606  exit( 1 );
607  }
608 #endif
609  return m_GrowthEfficiencyP[a_age]; }
double m_GrowthEfficiencyP[5001]
Precalculated growth efficiency for protein with size
Definition: hare_all.h:782

References m_GrowthEfficiencyP, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Young::st_Developing(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetHareRefNum()

int THare_Population_Manager::GetHareRefNum ( )
inline

Get the next ID number available.

548 { return ++m_RefNums; }
int m_RefNums
The last hare ID used
Definition: hare_all.h:754

References m_RefNums.

Referenced by THare::THareInit().

◆ GetInfantDensity()

int THare_Population_Manager::GetInfantDensity ( int  x,
int  y 
)
inline

Density function - returns the density of infants in the square containing by x,y. Each square is 256x256m in size.

651 { return m_DensityMap[hob_Infant][x >> __DENSITYSHIFT][y >> __DENSITYSHIFT]; }
@ hob_Infant
Definition: hare_all.h:57

References hob_Infant, and m_DensityMap.

◆ GetInterference()

double THare_Population_Manager::GetInterference ( int  h)
inline

Return the proportion of time used in communicating with con-specifics.

Based on:
m_Interference[i]=exp(i*cfg_HareInterferenceConstant)

700  {
701 #ifdef __BOUNDSCHECK
702  if ((h<0) || (h>2499)) {
703  m_TheLandscape->Warn( "Hare Interference range out of bounds", NULL );
704  exit( 1 );
705  }
706 #endif
707  return m_Interference[h]; //[m_variableDD];
708  }
double m_Interference[2500]
Array storing density-dependence effect with density
Definition: hare_all.h:760

References m_Interference, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Juvenile::st_Dispersal(), Hare_Juvenile::st_Foraging(), Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ GetJuvenileDensity()

int THare_Population_Manager::GetJuvenileDensity ( int  x,
int  y 
)
inline

Density function - returns the density of juveniles in the square containing by x,y. Each square is 256x256m in size.

661 { return m_DensityMap[hob_Juvenile][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Juvenile, and m_DensityMap.

◆ GetKJperM()

double THare_Population_Manager::GetKJperM ( int  a_size)
inline

Get the cost of moving 1m in KJ dependent upon mass (.

626  {
627 #ifdef __BOUNDSCHECK
628  if ((a_size<0) || (a_size>7000)) {
629  char sz[255];
630  _itoa(a_size,sz,10);
631  m_TheLandscape->Warn( "Hare GetKJperM a_size out of bounds", sz );
632  exit( 1 );
633  }
634 #endif
635  return m_KJperM[a_size]; }
double m_KJperM[7001]
Precalculated cost of locomotion - KJ per m per kg
Definition: hare_all.h:786

References m_KJperM, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), and Hare_Female::Init().

◆ GetLitterSize()

int THare_Population_Manager::GetLitterSize ( int  litter)

Returns the litter size.

Uses a frequency distribution out of 0-9999 and 6 bins and returns one of the bins as the return based on a random number from 0-9999

745 {
746  int testing=int(g_rand_uni()*10000);
747  for (int i=0; i<7; i++) {
748  if (testing<=m_LitterSize[litter][i]) return i;
749  }
750  // something wrong if the program gets to here
751  m_TheLandscape->Warn("THare_Population_Manager::GetLitterSize - litter size error",NULL);
752  exit(1);
753 }

References g_rand_uni, m_LitterSize, Population_Manager::m_TheLandscape, and Landscape::Warn().

◆ GetMaleDensity()

int THare_Population_Manager::GetMaleDensity ( int  x,
int  y 
)
inline

Density function - returns the density of males in the square containing by x,y. Each square is 256x256m in size.

666 { return m_DensityMap[hob_Male][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Male, and m_DensityMap.

◆ GetMaxDailyGrowthEnergy()

double THare_Population_Manager::GetMaxDailyGrowthEnergy ( int  a_age)
inline

Get the maximum daily energy needed for growth for this a_age

552  {
553 #ifdef __BOUNDSCHECK
554  if ((a_age<0) || (a_age>5000)) {
555  m_TheLandscape->Warn( "Hare GetMaxDailyGrowthEnergy a_age out of bounds", NULL );
556  exit( 1 );
557  }
558 #endif
559  return m_MaxDailyGrowthEnergy[a_age];
560  }
double m_MaxDailyGrowthEnergy[5001]
Precalculated max growth energy requirement with size
Definition: hare_all.h:774

References m_MaxDailyGrowthEnergy, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Female::DoLactation().

◆ GetMaxDailyGrowthEnergyF()

double THare_Population_Manager::GetMaxDailyGrowthEnergyF ( int  a_age)
inline

Get the maximum daily energy needed for growth for this a_age for use in fat construction.

578  {
579 #ifdef __BOUNDSCHECK
580  if ((a_age<0) || (a_age>5000)) {
581  m_TheLandscape->Warn( "Hare GetMaxDailyGrowthEnergyF a_age out of bounds", NULL );
582  exit( 1 );
583  }
584 #endif
585  return m_MaxDailyGrowthEnergyF[a_age]; }
double m_MaxDailyGrowthEnergyF[5001]
Precalculated max growth energy requirement with size for fat
Definition: hare_all.h:780

References m_MaxDailyGrowthEnergyF, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetMaxDailyGrowthEnergyP()

double THare_Population_Manager::GetMaxDailyGrowthEnergyP ( int  a_age)
inline

Get the maximum daily energy needed for growth for this a_age for use in protein construction.

565  {
566 #ifdef __BOUNDSCHECK
567  if ((a_age<0) || (a_age>5000)) {
568  m_TheLandscape->Warn( "Hare GetMaxDailyGrowthEnergyP a_age out of bounds", NULL );
569  exit( 1 );
570  }
571 #endif
572  return m_MaxDailyGrowthEnergyP[a_age];
573  }
double m_MaxDailyGrowthEnergyP[5001]
Precalculated max growth energy requirement with size for protein
Definition: hare_all.h:778

References m_MaxDailyGrowthEnergyP, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::st_Developing(), Hare_Young::st_Developing(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetPolyFood()

double THare_Population_Manager::GetPolyFood ( int  a_poly)
inline

Get stored polygon food quality.

713 { return m_PolyFood[a_poly]; }

References m_PolyFood.

Referenced by THare::ForageSquare(), and THare::ForageSquareP().

◆ GetRMR()

double THare_Population_Manager::GetRMR ( int  a_age,
double  a_size 
)

Returns the RMR given a specific age and mass.

RMR is weight dependent based on RMR=69.1*4.1868)w^0.808 (McNab 1988)
But affected by temperature. We assume that after 35days 1kg weight, that this effect is constant per kg

1034  {
1035  double a_temp = m_TheLandscape->SupplyTemp();
1036  if (a_temp>20.0) a_temp=20.0;
1037  double tempdiff=18.0-a_temp;// 18 is used because this was the value where Hacklander
1038  //started his expts - 20 is assumed thermoneutral point and
1039  // a linear relationship between these two
1040  // Adjust for rainfall - assume that if we have a rainfall of >5mm then the temp diff is maximum - removing this might help add variation to juvenile survivorship!
1041  double rainfall = m_TheLandscape->SupplyRain();
1042  if (rainfall>5.0) rainfall=5.0;
1043  tempdiff*=1.0+(rainfall*g_RMRrainFactor);
1044  //tempdiff*=1.0+((rainfall*rainfall*rainfall*g_RMRrainFactor)/25); // Gives a curve sloping up
1045 
1046 #ifdef __BOUNDSCHECK
1047  if (a_age<0) {
1048  m_TheLandscape->Warn( "Hare GetRMR a_age range out of bounds", NULL );
1049  exit( 1 );
1050  }
1051 #endif
1052  a_size/=1000.0;
1053  double RMR;
1054  if (a_age<37) {
1055  RMR=((tempdiff*m_RMR[0][a_age])+m_RMR[1][a_age])*(a_size);
1056  } else
1057  {
1058  a_age=36;
1059  RMR=(69.1*4.1868)*pow(a_size,0.808);
1060  RMR=RMR+(tempdiff*m_RMR[0][a_age]*a_size);
1061  }
1062  return RMR;
1063 }
double g_RMRrainFactor
Definition: Hare_all.cpp:51
double SupplyTemp(void)
Definition: landscape.h:1386
double SupplyRain(void)
Definition: landscape.h:1365
double m_RMR[2][366]
Precalculated RMR with age
Definition: hare_all.h:772

References g_RMRrainFactor, m_RMR, Population_Manager::m_TheLandscape, Landscape::SupplyRain(), Landscape::SupplyTemp(), and Landscape::Warn().

Referenced by THare::EnergyBalance(), THare::GetRMR(), Hare_Infant::st_Developing(), and Hare_Young::st_Foraging().

◆ GetTotalDensity()

int THare_Population_Manager::GetTotalDensity ( int  x,
int  y 
)
inline

Density function - returns the density of all hares in the square containing by x,y. Each square is 256x256m in size.

676 { return m_DensityMap[5][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References m_DensityMap.

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), and HuntingGrid().

◆ GetYoungDensity()

int THare_Population_Manager::GetYoungDensity ( int  x,
int  y 
)
inline

Density function - returns the density of young in the square containing by x,y. Each square is 256x256m in size.

656 { return m_DensityMap[hob_Young][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }
@ hob_Young
Definition: hare_all.h:58

References hob_Young, and m_DensityMap.

◆ Hunting()

void THare_Population_Manager::Hunting ( void  )
protected

Takes a fixed proportion of the population (input variable), in the middle of the hunting season.

4131  {
4132  m_shot=0;
4133  double huntpercent=cfg_HareHunting.value();
4134  Hare_Juvenile* AJH = NULL;
4135  unsigned size2;
4136  size2 = GetLiveArraySize(hob_Young);
4137  for ( unsigned j = 0; j < size2; j++ ) {
4138  AJH = dynamic_cast < Hare_Juvenile * > ( TheArray[ hob_Juvenile ] [ j ] );
4139  if ( g_rand_uni()< huntpercent) {
4140  // Must check if it is already dead of some other cause - is so can't kill it again
4141  if (AJH->GetCurrentStateNo() != -1)
4142  {
4143  AJH->ON_Dead(); // Kill it
4144  m_shot++;
4145  }
4146  }
4147  }
4148  Hare_Male* AH = NULL;
4149  size2 = GetLiveArraySize(hob_Male);
4150  for ( unsigned j = 0; j < size2; j++ ) {
4151  AH = dynamic_cast < Hare_Male * > ( TheArray[ hob_Male ] [ j ] );
4152  if ( g_rand_uni()< huntpercent) {
4153  if (AH->GetCurrentStateNo() != -1)
4154  {
4155  AH->ON_Dead(); // Kill it
4156  m_shot++;
4157  }
4158  }
4159  }
4160  Hare_Female* AFH = NULL;
4161  size2 = GetLiveArraySize(hob_Female);
4162  for ( unsigned j = 0; j < size2; j++ ) {
4163  AFH = dynamic_cast < Hare_Female * > ( TheArray[ hob_Female ] [ j ] );
4164  if ( g_rand_uni()< huntpercent) {
4165  if (AFH->GetCurrentStateNo() != -1)
4166  {
4167  AFH->ON_Dead(); // Kill it
4168  m_shot++;
4169  }
4170  }
4171  }
4172 }
CfgFloat cfg_HareHunting("HARE_HUNTING", CFG_CUSTOM, 0.15)
virtual void ON_Dead()
The female is dead.
Definition: Hare_all.cpp:3956
virtual void ON_Dead()
Definition: Hare_all.cpp:2654
virtual void ON_Dead()
Definition: Hare_all.cpp:3044
int GetCurrentStateNo()
Returns the current state number.
Definition: PopulationManager.h:121
int m_shot
Hunting Bag.
Definition: hare_all.h:756

References cfg_HareHunting, g_rand_uni, TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), hob_Female, hob_Juvenile, hob_Male, hob_Young, m_shot, Hare_Juvenile::ON_Dead(), Hare_Male::ON_Dead(), Hare_Female::ON_Dead(), Population_Manager::TheArray, and CfgFloat::value().

Referenced by DoAlmostLast().

◆ HuntingDifferentiatedBeetleBankArea()

void THare_Population_Manager::HuntingDifferentiatedBeetleBankArea ( void  )
protected

Differential hunting inside a specific area designated as beetlebank addition area. Takes a fixed proportion of the population (input variable for inside and outside), in the middle of the hunting season

4178  {
4179  m_shot=0;
4180  int tx1 = cfg_BeetleBankMinX.value();
4181  int tx2 = cfg_BeetleBankMaxX.value();
4182  int ty1 = cfg_BeetleBankMinY.value();
4183  int ty2 = cfg_BeetleBankMaxY.value();
4184  double huntpercent_out, huntpercent_in;
4185  if (!cfg_BeetleBankInvert.value())
4186  {
4187  huntpercent_out =cfg_HareHunting.value();
4188  huntpercent_in =cfg_HareHuntingBeetleBankArea.value();
4189  }
4190  else
4191  {
4192  huntpercent_in =cfg_HareHunting.value();
4193  huntpercent_out =cfg_HareHuntingBeetleBankArea.value();
4194  }
4195  THare* AH = NULL;
4196  unsigned size2;
4197  for (int ind =hob_Juvenile; ind < hob_Foobar; ind++)
4198  {
4199  size2 = (unsigned)GetLiveArraySize(ind);
4200  for ( unsigned j = 0; j < size2; j++ )
4201  {
4202  AH = dynamic_cast < THare * > ( TheArray[ ind ] [ j ] );
4203  APoint xy = AH->SupplyPoint();
4204  if ((xy.m_x >= tx1) && (xy.m_y >= ty1) && (xy.m_x <= tx2) && (xy.m_y <= ty2))
4205  {
4206  if ( g_rand_uni()< huntpercent_in)
4207  {
4208  AH->ON_Dead(); // Kill it
4209  m_shot++;
4210  }
4211  } else
4212  {
4213  if ( g_rand_uni()< huntpercent_out)
4214  {
4215  AH->ON_Dead(); // Kill it
4216  m_shot++;
4217  }
4218  }
4219  }
4220  }
4221 }
CfgBool cfg_BeetleBankInvert
CfgInt cfg_BeetleBankMinX
CfgInt cfg_BeetleBankMaxY
CfgFloat cfg_HareHuntingBeetleBankArea("HARE_HUNTING_BEETLEBANKAREA", CFG_CUSTOM, 0.95)
CfgInt cfg_BeetleBankMinY
CfgInt cfg_BeetleBankMaxX
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
int m_y
Definition: ALMaSS_Setup.h:56
int m_x
Definition: ALMaSS_Setup.h:55
bool value(void)
Definition: configurator.h:135
APoint SupplyPoint()
Definition: PopulationManager.h:209
virtual void ON_Dead(void)
Mortality - overridden in descendent classes.
Definition: hare_all.h:424
@ hob_Foobar
Definition: hare_all.h:62

References cfg_BeetleBankInvert, cfg_BeetleBankMaxX, cfg_BeetleBankMaxY, cfg_BeetleBankMinX, cfg_BeetleBankMinY, cfg_HareHunting, cfg_HareHuntingBeetleBankArea, g_rand_uni, Population_Manager::GetLiveArraySize(), hob_Foobar, hob_Juvenile, m_shot, APoint::m_x, APoint::m_y, THare::ON_Dead(), TAnimal::SupplyPoint(), Population_Manager::TheArray, CfgInt::value(), CfgFloat::value(), and CfgBool::value().

Referenced by DoAlmostLast().

◆ HuntingGrid()

void THare_Population_Manager::HuntingGrid ( void  )
protected

Hunting version based on grid squares - hunting occurs only if there are enough hares in each grid square.
Density squares are 256x256m in size, so for each ca 1 square km we need 8x8 of these squares, if total numbers is greater than a threshold then we hunt.

4227  {
4228  int N;
4229  m_shot=0;
4230  for (int x=500; x<SimW; x+=1000) {
4231  for (int y=500; y<SimH; y+=1000) {
4232  // For each 1km square
4233  N=0;
4234  for (int xx=x-(256+128); xx<=x+(256+128); xx+=256) {
4235  for (int yy=y-(256+128); yy<=y+(256+128); yy+=256) {
4236  N+=GetTotalDensity(xx,yy);
4237  }
4238  }
4239  if (N>cfg_HareHuntingThreshold.value()) {
4240  double huntpercent=cfg_HareHunting.value();
4241  Hare_Juvenile* AJH = NULL;
4242  unsigned size2;
4243  size2 = GetLiveArraySize(hob_Juvenile);
4244  for ( unsigned j = 0; j < size2; j++ ) {
4245  AJH = dynamic_cast < Hare_Juvenile * > ( TheArray[ hob_Juvenile ] [ j ] );
4246  if ((AJH->Supply_m_Location_x() >=x-500) &&(AJH->Supply_m_Location_x()< x+500) && (AJH->Supply_m_Location_y() >=y-500) && (AJH->Supply_m_Location_y()< y+500)) {
4247  if ( g_rand_uni()< huntpercent) {
4248  if (AJH->GetCurrentStateNo() != -1) {
4249  AJH->ON_Dead(); // Kill it
4250  m_shot++;
4251  }
4252  }
4253  }
4254  }
4255  Hare_Male* AH = NULL;
4256  size2 = GetLiveArraySize(hob_Male);
4257  for ( unsigned j = 0; j < size2; j++ ) {
4258  AH = dynamic_cast < Hare_Male * > ( TheArray[ hob_Male ] [ j ] );
4259  if ((AH->Supply_m_Location_x() >=x-500) &&(AH->Supply_m_Location_x()< x+500) && (AH->Supply_m_Location_y() >=y-500) && (AH->Supply_m_Location_y()< y+500)) {
4260  if ( g_rand_uni()< huntpercent) {
4261  if (AH->GetCurrentStateNo() != -1) {
4262  AH->ON_Dead(); // Kill it
4263  m_shot++;
4264  }
4265  }
4266  }
4267  }
4268  Hare_Female* AFH = NULL;
4269  size2 = GetLiveArraySize(hob_Female);
4270  for ( unsigned j = 0; j < size2; j++ ) {
4271  AFH = dynamic_cast < Hare_Female * > ( TheArray[ hob_Female ] [ j ] );
4272  if ((AFH->Supply_m_Location_x() >=x-500) && (AFH->Supply_m_Location_x()< x+500) && (AFH->Supply_m_Location_y() >=y-500) && (AFH->Supply_m_Location_y()< y+500)) {
4273  if ( g_rand_uni()< huntpercent) {
4274  if (AFH->GetCurrentStateNo() != -1) {
4275  AFH->ON_Dead(); // Kill it
4276  m_shot++;
4277  }
4278  }
4279  }
4280  }
4281  }
4282  }
4283  }
4284 }
CfgInt cfg_HareHuntingThreshold("HARE_HUNTING_THRESHOLD", CFG_CUSTOM, 0)
int SimH
Definition: PopulationManager.h:511
int SimW
Definition: PopulationManager.h:511
int Supply_m_Location_x()
Definition: PopulationManager.h:213
int Supply_m_Location_y()
Definition: PopulationManager.h:216
int GetTotalDensity(int x, int y)
Density function - returns the density of all hares in the square containing by x,...
Definition: hare_all.h:676

References cfg_HareHunting, cfg_HareHuntingThreshold, g_rand_uni, TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), GetTotalDensity(), hob_Female, hob_Juvenile, hob_Male, m_shot, Hare_Juvenile::ON_Dead(), Hare_Male::ON_Dead(), Hare_Female::ON_Dead(), Population_Manager::SimH, Population_Manager::SimW, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::TheArray, CfgInt::value(), and CfgFloat::value().

Referenced by DoAlmostLast().

◆ Init()

void THare_Population_Manager::Init ( void  )
protected

Sets up data structures and calculations prior to starting simulation.

Creates some hares in semi-sensible places.

open the probe

Set up before step action sorts This determines how we handle the arrays between steps

Load State Names - these are just used to tell us what the animal is doing in the GUI

Loads a data file giving max daily growth at age together with cost of that growth per g. These are up to day 365. After 365 the cost is constant and assumes only fat is added

Calculates RMR based on Hacklander - these are the thermoneutral values

Ensure zeros in the density map!

Intitialise the Pattern Oriented Modelling output file

403 {
408  m_RefNums=0;
411  if ( cfg_RipleysOutput_used.value() ) {
413  }
416  } else ReallyBigOutputPrb=0;
420  BodyBurdenPrb = fopen("HareBodyBurden.txt", "w");
421  if (!BodyBurdenPrb) {
422  g_msg->Warn(WARN_FILE, "Population_Manager::OpenBodyBurdenProbe(): ""Unable to open probe file", "HareBodyBurden.txt");
423  exit(1);
424  }
425  //-----------------------------------------------------------------------------
426  // Initialisation code for the hare population manager
427  strcpy(m_SimulationName,"Hare");
428  // Load List of Hare Classes
429  m_ListNames[0]="Infant";
430  m_ListNames[1]="Young";
431  m_ListNames[2]="Juvenile";
432  m_ListNames[3]="Male";
433  m_ListNames[4]="Female";
434  m_ListNameLength = 5;
436  // Create an instance of THare to set static members
437  THare* thare = new THare( 0, 0, m_TheLandscape, this );
438  thare->loadVegPalatability();
439  delete thare;
443  BeforeStepActions[0]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
444  BeforeStepActions[1]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
445  BeforeStepActions[2]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
446  BeforeStepActions[3]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
447  BeforeStepActions[4]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
448 
452  StateNames[tohs_InitialState] = "Initial State";
453  StateNames[ tohs_NextStage ] = "Next Stage";
454  StateNames[ tohs_Developing ] = "Development";
455  StateNames[ tohs_Dispersal ] = "Dispersal";
456  StateNames[ tohs_Foraging ] = "Foraging";
457  StateNames[ tohs_Resting ] = "Resting";
458  StateNames[ tohs_Running ] = "Running";
459  StateNames[ tohs_ReproBehaviour ] = "ReprodBehaviour";
460  StateNames[ tohs_Dying ] = "Dying";
461 
462  // Deal with peg global
464  // Create some hares
465  // This is only used when the simulation starts and puts a starting number of
466  // hares in the landscape at random positions
467  //
468  struct_Hare* sp;
469  sp = new struct_Hare;
470  sp->HM = this;
471  sp->L = m_TheLandscape;
472  sp->age=365;
473  sp->weight=3800/3;
474  sp->RefNum=0;
475  bool b;
476  for (int i=0; i<cfg_hare_StartingNo.value(); i++)
477  {
478  do {
479  sp->x = random(SimW);
480  sp->y = random(SimH);
482  switch (te)
483  {
484  case tole_Building:
485  case tole_Freshwater:
486  case tole_FishFarm:
487  case tole_Pond:
488  case tole_River:
489  case tole_Saltwater:
490  case tole_Coast:
491  case tole_BareRock:
492  case tole_AmenityGrass:
493  case tole_Parkland:
494  case tole_UrbanNoVeg:
495  case tole_UrbanPark:
497  case tole_SandDune:
498  case tole_Copse:
499  case tole_MetalledPath:
500  case tole_Carpark:
501  case tole_Churchyard:
502  case tole_Stream:
503  case tole_HeritageSite:
504  b=false;
505  break;
506  default:
507  b=true;
508  }
509  }
510  while (!b);
511  CreateObjects(3,NULL,NULL,sp,1); // 3 = Males
512  }
513  for (int i=0; i<cfg_hare_StartingNo.value(); i++)
514  {
515  do {
516  sp->x = random(SimW);
517  sp->y = random(SimH);
519  switch (te)
520  {
521  case tole_Building:
522  case tole_Pond:
523  case tole_Freshwater:
524  case tole_FishFarm:
525  case tole_River:
526  case tole_Saltwater:
527  case tole_Coast:
528  case tole_BareRock:
529  case tole_AmenityGrass:
530  case tole_Parkland:
531  case tole_UrbanNoVeg:
532  case tole_UrbanPark:
534  case tole_SandDune:
535  case tole_Copse:
536  case tole_MetalledPath:
537  case tole_Carpark:
538  case tole_Churchyard:
539  case tole_Stream:
540  case tole_HeritageSite:
541  b=false;
542  break;
543  default:
544  b=true;
545  }
546  }
547  while (!b);
548  CreateObjects(4,NULL,NULL,sp,1); // 4 = Females
549  }
550  delete sp;
555  double weightDM, rmr, f0, f1,f2,protcost,fatcost, totalgrowthcost;
556  ifstream* HareDataFile = new ifstream("Hare_GrowthALMaSS_Input.txt", ios::in);
557  if (!HareDataFile->is_open()) {
558  // This is an error since we are running hares - so say so.
559  m_TheLandscape->Warn("THare_Population_Manager::Init - Hare_GrowthALMaSS_Input.txt is missing or in use", "");
560  exit(1);
561  }
562  else {
563  // File format: "Age" "Ing-free dmBW (g,dm)" "Protein W-gain (g,dm)" "Fat W-gain (g,dm)"
564  // "KJcost prot" "KJ cost fat" "Energy cost (kJ) to achieve BW gain " "resting energy kJ"
565  for (int i = 0; i<5000; i++) {
566  (*HareDataFile) >> f0 >> weightDM >> f1 >> f2 >> protcost >> fatcost >> totalgrowthcost >> rmr;
567  // These arrays are little wasteful of space because many are only really used for the first 36 days, but
568  // if this is a problem it can be fixed later CJT 12-09-2006
569  m_MaxDailyGrowthEnergyP[i] = protcost; // How much energy for protein growth max at age i
570  if (protcost>0) m_GrowthEfficiencyP[i] = f1 / protcost; // KJ per g protein at age i
571  else m_GrowthEfficiencyP[i] = 0;
572  m_MaxDailyGrowthEnergyF[i] = fatcost; // How much energy for fat growth max at age i
573  if (fatcost>0) m_GrowthEfficiencyF[i] = f2 / fatcost; // KJ per g fat at age i
574  else m_GrowthEfficiencyF[i] = 0;
575  // No 366 is in fact the value for day 366 and rest of life and is about adding only fat
576  m_MaxDailyGrowthEnergy[i] = totalgrowthcost;
577  m_GrowthEfficiency[i] = (f1 + f2) / totalgrowthcost;
578  m_DMWeight[i] = weightDM*cfg_min_growth_attain.value(); // Used to test for falling behind in growth
579  }
580  HareDataFile->close();
581  }
582 
586  m_RMR[0][0]=0;
587  m_RMR[1][0]=0;
588  /* OLD CODE
589  for (int i=1; i<7001; i++) {
590  m_RMR[i]=((3.8*pow((double(i)/(0.88*0.33)),-0.27))*20.1*24)*((double(i)/(0.88*0.33))/1000.0); // KJ/day See energetics notes
591  }
592  */
593  for (int i=1; i<=37; i++) {
594  m_RMR[0][i]=(-1.5658*i + 58.487); // Slope KJ/day/degree See energetics notes
595  m_RMR[1][i]=1525.4*pow(i,-0.3997); // KJ/day See energetics notes
596  }
597 
598 
599  // Energy for walking dependent upon weight KJ per m
600  for (int i=1; i<7001; i++) {
601  //m_KJperM[i]=(9.08*pow(((double (i)/(0.88*0.33))/1000.0),0.77344))*0.001; // KJ/M for each weight
602  double fi=3.75*i/1000.0; // Corrected for dw to ww + ingesta
603  // m_KJperM[i]=(10.7*pow(fi,-0.316)*fi)/1000.0;
604  m_KJperM[i] = (10.7*pow(fi, cfg_HareWalkingPowerConst.value())*fi) / 1000.0;
605  }
606  m_KJperM[0]=0.0;
607 
608  double mean=cfg_littersize_mean1.value();
609  double SD=cfg_littersize_SD1.value();
610  CalcLitterSize(mean,SD,0);
611 
614  CalcLitterSize(mean,SD,1);
615 
618  CalcLitterSize(mean,SD,2);
619 
622  CalcLitterSize(mean,SD,3);
623 
626  CalcLitterSize(mean,SD,4);
627 
630  CalcLitterSize(mean,SD,5);
631 
634  CalcLitterSize(mean,SD,6);
635 
638  CalcLitterSize(mean,SD,7);
639 
642  CalcLitterSize(mean,SD,8);
643 
646  CalcLitterSize(mean,SD,9);
647 
650  CalcLitterSize(mean,SD,10);
651 
654  CalcLitterSize(mean,SD,11);
655 
656  for (int i=1; i<2500; i++) {
658  }
659  m_Interference[0]=1.0;
660 
664  for (int i=0; i<200; i++) {
665  for (int j=0; j<200; j++) {
666  m_DensityMap[0][i][j]=0;
667  m_DensityMap[1][i][j]=0;
668  m_DensityMap[2][i][j]=0;
669  m_DensityMap[3][i][j]=0;
670  m_DensityMap[4][i][j]=0;
671  m_DensityMap[5][i][j]=0;
672  m_DensityMap[6][i][j]=0;
673  m_DensityMap[7][i][j]=0;
674  }
675  }
676  m_PolyFood = (double*)malloc(sizeof(double)* (1+m_TheLandscape->SupplyLargestPolyNumUsed()) );
677  if ( m_PolyFood == NULL ) {
678  g_msg->Warn( WARN_FILE, "HarePopulationManager::Init: Out of memory!", "" );
679  exit( 1 );
680  }
684  FILE* fp;
685  fp=fopen("LitterProduction.txt","w");
686  fclose(fp);
687  fp=fopen("EnergyCheck.txt","w");
688  fclose(fp);
689  fp=fopen("POM_Hare.txt","w");
690  fprintf(fp,"1) Timestep,\n");
691  fprintf(fp,"2-6) Population Size of add stages,\n");
692  fprintf(fp,"7) Females < 365 days old,\n");
693  fprintf(fp,"8) Females >=1 & < 2 yrs old,\n");
694  fprintf(fp,"9) Females >=2 & < 3 yrs old,\n");
695  fprintf(fp,"10) Females >=3 & < 4 yrs old,\n");
696  fprintf(fp,"11) Females >=4 & < 5 yrs old,\n");
697  fprintf(fp,"12) Females >=4 yrs old,\n");
698  fprintf(fp,"13) Mean bodyweight of females (dw),\n");
699  fprintf(fp,"14) variance in bodyweight,\n");
700  fclose(fp);
701  fp=fopen("POM_FemaleHareWeights.txt","w");
702  fclose(fp);
703  // Mortality variables
704  m_variableDD=10;
705  // MRR
706  m_OurMRRData = new MRR_Data;
707 }
static CfgFloat cfg_littersize_SD10("HARE_LITTERSIZE_SD_J", CFG_CUSTOM, 0.6415)
static CfgFloat cfg_hare_peg_inertia("HARE_PEG_INERTIA", CFG_CUSTOM, 0.20)
static CfgFloat cfg_littersize_SD4("HARE_LITTERSIZE_SD_D", CFG_CUSTOM, 0.6415)
CfgFloat cfg_VegHeightForageReduction("HARE_VEGHEIGHTFORAGEREDUCTION", CFG_CUSTOM, 0.0003)
static CfgFloat cfg_littersize_mean6("HARE_LITTERSIZE_MEAN_F", CFG_CUSTOM, 1.72)
static CfgFloat cfg_littersize_mean11("HARE_LITTERSIZE_MEAN_K", CFG_CUSTOM, 1.72)
static CfgFloat cfg_littersize_mean3("HARE_LITTERSIZE_MEAN_C", CFG_CUSTOM, 2.514)
static CfgFloat cfg_littersize_SD2("HARE_LITTERSIZE_SD_B", CFG_CUSTOM, 0.957)
CfgFloat cfg_HareInterferenceConstant("HARE_INTERFERENCECONSTANT", CFG_CUSTOM,-0.03)
CfgFloat cfg_HareMortStochasticity("HARE_MORTSTOCHASTICITY", CFG_CUSTOM, 1.0)
CfgInt cfg_FarmIntensivenessH("HARE_FARMINTENSIVENESSH", CFG_CUSTOM, 10)
static CfgFloat cfg_littersize_mean12("HARE_LITTERSIZE_MEAN_L", CFG_CUSTOM, 0.0)
static CfgFloat cfg_littersize_mean4("HARE_LITTERSIZE_MEAN_D", CFG_CUSTOM, 1.72)
static CfgFloat cfg_littersize_SD9("HARE_LITTERSIZE_SD_I", CFG_CUSTOM, 0.6415)
static CfgFloat cfg_littersize_mean8("HARE_LITTERSIZE_MEAN_H", CFG_CUSTOM, 1.72)
CfgFloat cfg_FarmIntensiveness("HARE_FARMINTENSIVENESS", CFG_CUSTOM, 0.01)
static CfgFloat cfg_littersize_mean1("HARE_LITTERSIZE_MEAN_A", CFG_CUSTOM, 1.535)
static CfgFloat cfg_littersize_mean5("HARE_LITTERSIZE_MEAN_E", CFG_CUSTOM, 1.72)
static CfgFloat cfg_littersize_SD11("HARE_LITTERSIZE_SD_K", CFG_CUSTOM, 0.6415)
double g_hare_peg_inertia
Definition: Hare_all.cpp:50
CfgBool cfg_ReallyBigOutput_used
static CfgFloat cfg_littersize_SD8("HARE_LITTERSIZE_SD_H", CFG_CUSTOM, 0.6415)
double g_FarmIntensivenessH
Definition: Hare_all.cpp:284
double g_FarmIntensiveness
Definition: Hare_all.cpp:283
CfgFloat cfg_RMRrainFactor("HARE_RMRRAINFACTOR", CFG_CUSTOM, 0.47)
static CfgFloat cfg_littersize_SD3("HARE_LITTERSIZE_SD_C", CFG_CUSTOM, 0.955)
CfgFloat cfg_HareWalkingPowerConst("HARE_WALKINGPOWERCONST", CFG_CUSTOM, -0.316)
static CfgFloat cfg_littersize_mean10("HARE_LITTERSIZE_MEAN_J", CFG_CUSTOM, 1.72)
static CfgFloat cfg_littersize_SD1("HARE_LITTERSIZE_SD_A", CFG_CUSTOM, 0.685)
double g_VegHeightForageReduction
Used to scale access to crops for modern day farm intensiveness.
Definition: Hare_all.cpp:282
static CfgFloat cfg_littersize_mean2("HARE_LITTERSIZE_MEAN_B", CFG_CUSTOM, 2.508)
static CfgFloat cfg_littersize_SD12("HARE_LITTERSIZE_SD_L", CFG_CUSTOM, 0.0)
CfgInt cfg_HareThresholdDD("HARE_THRESHOLDDD", CFG_CUSTOM, 5)
static CfgFloat cfg_littersize_SD6("HARE_LITTERSIZE_SD_F", CFG_CUSTOM, 0.6415)
CfgBool cfg_RipleysOutput_used
static CfgFloat cfg_littersize_mean9("HARE_LITTERSIZE_MEAN_I", CFG_CUSTOM, 1.72)
static CfgFloat cfg_littersize_SD5("HARE_LITTERSIZE_SD_E", CFG_CUSTOM, 0.6415)
static CfgFloat cfg_littersize_SD7("HARE_LITTERSIZE_SD_G", CFG_CUSTOM, 0.955)
static CfgInt cfg_hare_StartingNo("HARE_START_NO", CFG_CUSTOM, 50)
static CfgFloat cfg_littersize_mean7("HARE_LITTERSIZE_MEAN_G", CFG_CUSTOM, 2.17)
CfgFloat cfg_min_growth_attain("HARE_MINGROWTHATTAIN", CFG_CUSTOM, 0.475)
@ TOP_Hare
Definition: PopulationManager.h:64
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
Class for running mark-release-recapture experiments.
Definition: hare_all.h:118
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
FILE * ReallyBigOutputPrb
Definition: PopulationManager.h:595
const char * m_ListNames[32]
Definition: PopulationManager.h:537
char m_SimulationName[255]
Definition: PopulationManager.h:513
unsigned BeforeStepActions[12]
Definition: PopulationManager.h:542
const char * StateNames[100]
Definition: PopulationManager.h:531
bool OpenTheRipleysOutputProbe(string a_NWordFilename)
Definition: PopulationManager.cpp:757
unsigned m_ListNameLength
Definition: PopulationManager.h:538
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:580
bool OpenTheReallyBigProbe()
Definition: PopulationManager.cpp:859
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
Method used to create new hares.
Definition: Hare_all.cpp:928
double m_DMWeight[5001]
Array for storing minimum acceptable size with age.
Definition: hare_all.h:746
int m_HareThresholdDD
Input variable - Threshold density dependence level.
Definition: hare_all.h:750
void CalcLitterSize(double mean, double SD, int litter)
Definition: Hare_all.cpp:709
void loadVegPalatability(void)
Loads static member m_vegPalatability with data.
Definition: Hare_THare.cpp:116
Class used to pass hare information to CreateObjects.
Definition: hare_all.h:135
@ tohs_Foraging
Definition: hare_all.h:75
@ tohs_Developing
Definition: hare_all.h:73
@ tohs_NextStage
Definition: hare_all.h:72
@ tohs_InitialState
Definition: hare_all.h:71
@ tohs_Resting
Definition: hare_all.h:76
@ tohs_Dispersal
Definition: hare_all.h:74
@ tohs_Dying
Definition: hare_all.h:79
@ tohs_Running
Definition: hare_all.h:78
@ tohs_ReproBehaviour
Definition: hare_all.h:77
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
@ WARN_FILE
Definition: maperrormsg.h:37
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
@ tole_BareRock
Definition: tole_declaration.h:75
@ tole_Carpark
Definition: tole_declaration.h:85
@ tole_Coast
Definition: tole_declaration.h:67
@ tole_UrbanNoVeg
Definition: tole_declaration.h:78
@ tole_Stream
Definition: tole_declaration.h:89
@ tole_Saltwater
Definition: tole_declaration.h:66
@ tole_HeritageSite
Definition: tole_declaration.h:90
@ tole_River
Definition: tole_declaration.h:65
@ tole_Parkland
Definition: tole_declaration.h:77
@ tole_UrbanPark
Definition: tole_declaration.h:79
@ tole_Pond
Definition: tole_declaration.h:101
@ tole_Copse
Definition: tole_declaration.h:82
@ tole_Freshwater
Definition: tole_declaration.h:64
@ tole_Building
Definition: tole_declaration.h:62
@ tole_Churchyard
Definition: tole_declaration.h:86
@ tole_BuiltUpWithParkland
Definition: tole_declaration.h:80
@ tole_AmenityGrass
Definition: tole_declaration.h:76
@ tole_SandDune
Definition: tole_declaration.h:81
@ tole_MetalledPath
Definition: tole_declaration.h:84
@ tole_FishFarm
Definition: tole_declaration.h:102

References struct_Hare::age, Population_Manager::BeforeStepActions, BodyBurdenPrb, CalcLitterSize(), cfg_FarmIntensiveness, cfg_FarmIntensivenessH, cfg_hare_peg_inertia, cfg_hare_StartingNo, cfg_HareInterferenceConstant, cfg_HareMortStochasticity, cfg_HareThresholdDD, cfg_HareWalkingPowerConst, cfg_littersize_mean1, cfg_littersize_mean10, cfg_littersize_mean11, cfg_littersize_mean12, cfg_littersize_mean2, cfg_littersize_mean3, cfg_littersize_mean4, cfg_littersize_mean5, cfg_littersize_mean6, cfg_littersize_mean7, cfg_littersize_mean8, cfg_littersize_mean9, cfg_littersize_SD1, cfg_littersize_SD10, cfg_littersize_SD11, cfg_littersize_SD12, cfg_littersize_SD2, cfg_littersize_SD3, cfg_littersize_SD4, cfg_littersize_SD5, cfg_littersize_SD6, cfg_littersize_SD7, cfg_littersize_SD8, cfg_littersize_SD9, cfg_min_growth_attain, cfg_ReallyBigOutput_used, cfg_RipleysOutput_used, cfg_RMRrainFactor, cfg_VegHeightForageReduction, CreateObjects(), g_FarmIntensiveness, g_FarmIntensivenessH, g_hare_peg_inertia, g_msg, g_RMRrainFactor, g_VegHeightForageReduction, struct_Hare::HM, struct_Hare::L, THare::loadVegPalatability(), m_DensityMap, m_DMWeight, m_GrowthEfficiency, m_GrowthEfficiencyF, m_GrowthEfficiencyP, m_HareThresholdDD, m_Interference, m_KJperM, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, m_MaxDailyGrowthEnergy, m_MaxDailyGrowthEnergyF, m_MaxDailyGrowthEnergyP, m_MortStochast, m_OurMRRData, m_PolyFood, Population_Manager::m_population_type, m_RefNums, m_RMR, Population_Manager::m_SimulationName, Population_Manager::m_TheLandscape, m_variableDD, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), random(), Population_Manager::ReallyBigOutputPrb, struct_Hare::RefNum, Population_Manager::SimH, Population_Manager::SimW, Population_Manager::StateNames, Landscape::SupplyElementType(), Landscape::SupplyLargestPolyNumUsed(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_NextStage, tohs_ReproBehaviour, tohs_Resting, tohs_Running, tole_AmenityGrass, tole_BareRock, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_Copse, tole_FishFarm, tole_Freshwater, tole_HeritageSite, tole_MetalledPath, tole_Parkland, tole_Pond, tole_River, tole_Saltwater, tole_SandDune, tole_Stream, tole_UrbanNoVeg, tole_UrbanPark, TOP_Hare, CfgInt::value(), CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), Landscape::Warn(), WARN_FILE, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by THare_Population_Manager().

◆ MRROutputs()

void THare_Population_Manager::MRROutputs ( )
protected

Special probe for data to be used in mark-release-recapture simulations.

What this has to do is to print to the MMR file the occurence if any of each animal that ever existed between two dates.
If that animal has been counted before then add to that animals line, otherwise create a new line.
Requires that each hare has a unique ID number.
NB this counts the population with zero error.

1232  {
1233  //
1234  // Step one - do we count today?
1236  int day=m_TheLandscape->SupplyDayInYear();
1237  if ((day!=cfg_MRR1.value()) && (day!=cfg_MRR2.value()) && (day!=cfg_MRR3.value()) && (day!=cfg_MRR4.value()) && (day!=cfg_MRR5.value())) return;
1238  // We want to count today
1239  // Loop through all Juvenile and Adult hares and put their details in the MRR data array
1240  unsigned size = GetLiveArraySize(hob_Juvenile);
1241  for (unsigned j=0; j<size; j++) { // Every other one, so assume 50% males
1242  Hare_Juvenile* HJ;
1243  HJ = dynamic_cast<Hare_Juvenile*>(TheArray[hob_Juvenile][j]);
1245  }
1246  size = GetLiveArraySize(hob_Female);
1247  for (unsigned j=0; j<size; j++) {
1248  Hare_Female* HF;
1249  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
1251  }
1252  size= GetLiveArraySize(hob_Male);
1253  for (unsigned j=0; j<size; j++) {
1254  Hare_Male* HM;
1255  HM = dynamic_cast<Hare_Male*>(TheArray[hob_Male][j]);
1257  }
1258 
1259  // If we need to dump the results this time do this
1262 }
static CfgInt cfg_MRR4("HARE_MMRFOUR", CFG_CUSTOM, 999)
static CfgInt cfg_MRR3("HARE_MMRTHREE", CFG_CUSTOM, 999)
static CfgInt cfg_MRR_FirstYear("HARE_MRRFIRSTYEAR", CFG_CUSTOM, 10000)
static CfgInt cfg_MRR5("HARE_MMRFIVE", CFG_CUSTOM, 270)
static CfgInt cfg_MRR2("HARE_MMRTWO", CFG_CUSTOM, 999)
static CfgInt cfg_MRR1("HARE_MMRONE", CFG_CUSTOM, 999)
static CfgInt cfg_MRR_LastYear("HARE_MRRLASTYEAR", CFG_CUSTOM, 0)
void AddEntry(int a_RefNum)
Definition: Hare_all.cpp:4298
void OutputToFile()
Definition: Hare_all.cpp:4340
void IncTrapping()
Definition: hare_all.h:123
int GetRefNum()
Get the refnum for this hare.
Definition: hare_all.h:419

References MRR_Data::AddEntry(), cfg_MRR1, cfg_MRR2, cfg_MRR3, cfg_MRR4, cfg_MRR5, cfg_MRR_FirstYear, cfg_MRR_LastYear, Population_Manager::GetLiveArraySize(), THare::GetRefNum(), hob_Female, hob_Juvenile, hob_Male, MRR_Data::IncTrapping(), m_OurMRRData, Population_Manager::m_TheLandscape, MRR_Data::OutputToFile(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, and CfgInt::value().

Referenced by DoLast().

◆ POMOutputs()

void THare_Population_Manager::POMOutputs ( )
protected

This method is called to dump the information needed for POM approaches.

The data dumped is variable dependent upon what is needed at the time. Contents vary from version to version.

1073  {
1074  //
1075  // Outputs are:
1076  // 1) Timestep
1077  // 2-6) Population Size of add stages
1078  // 7) Females < 2 yrs old
1079  // 8) Females >=2 & < 3 yrs old
1080  // 9) Females >=3 & < 4 yrs old
1081  // 10) Females >=4 & < 5 yrs old
1082  // 11) Females >=5 yrs old
1083  // 12) Mean bodyweight of females (dw)
1084  // 13) variance in bodyweight
1085  // 14) Mean yearlings
1086  // 14) Var yearlings
1087  // 16) m_shot
1088 
1089  int age0 = 0;
1090  int age1 = 0;
1091  int age2 = 0;
1092  int age3 = 0;
1093  int age4 = 0;
1094  int age5 = 0;
1095  int age6 = 0;
1096  int age7 = 0;
1097  double totweight = 0.0;
1098  double totweight2 = 0.0;
1099  double yearlingstotweight = 0.0;
1100  double yearlingstotweight2 = 0.0;
1101  FILE* POMOut = fopen("POM_Hare.txt", "a");
1102  FILE* POMOut2 = fopen("POM_FemaleHareWeights.txt", "a");
1103  if (!POMOut) {
1104  // something wrong if the program gets to here
1105  m_TheLandscape->Warn("THare_Population_Manager::POMOutputs - POM_Output.txt can't be opened", NULL);
1106  exit(1);
1107  }
1108  // Now sort out the data for the females
1109  int yearlingssize = 0;
1110  unsigned size = GetLiveArraySize(hob_Juvenile);
1111  for (unsigned j = 0; j<size; j += 2) { // Every other one, so assume 50% males
1112  Hare_Juvenile* HJ;
1113  HJ = dynamic_cast<Hare_Juvenile*>(TheArray[hob_Juvenile][j]);
1114  double bw = HJ->GetTotalWeight();
1115  if (bw>1000) {
1116  yearlingstotweight += bw; // This removes hares that are still almost leverets
1117  yearlingstotweight2 += (bw*bw);
1118  yearlingssize++;
1119  fprintf(POMOut2, "0\t%g\n", (float)bw);
1120  }
1121  }
1122  size = GetLiveArraySize(hob_Female);
1123  for (unsigned j = 0; j < size; j++) {
1124  Hare_Female* HF;
1125  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
1126  double bw = HF->GetTotalWeight();
1127  if (HF->GetAge() < 365) {
1128  age0++;
1129  if (bw>333) {
1130  yearlingstotweight += bw; // This removes hares that are still almost leverets
1131  yearlingstotweight2 += (bw*bw);
1132  yearlingssize++;
1133  }
1134  fprintf(POMOut2, "0\t%g\n", (float)bw);
1135  }
1136  else {
1137  totweight += bw;
1138  totweight2 += (bw*bw);
1139  if (HF->GetAge() < 730) {
1140  age1++;
1141  fprintf(POMOut2, "1\t%g\n", (float)bw);
1142  }
1143  else if (HF->GetAge() < 1095) {
1144  age2++;
1145  fprintf(POMOut2, "2\t%g\n", (float)bw);
1146  }
1147  else if (HF->GetAge() < 1460) {
1148  age3++;
1149  fprintf(POMOut2, "3\t%g\n", (float)bw);
1150  }
1151  else if (HF->GetAge() < 1825) {
1152  age4++;
1153  fprintf(POMOut2, "4\t%g\n", (float)bw);
1154  }
1155  else if (HF->GetAge() < 2190) {
1156  age5++;
1157  fprintf(POMOut2, "5\t%g\n", (float)bw);
1158  }
1159  else if (HF->GetAge() < 2555) {
1160  age6++;
1161  fprintf(POMOut2, "6\t%g\n", (float)bw);
1162  }
1163  else {
1164  age7++;
1165  fprintf(POMOut2, "7\t%g\n", (float)bw);
1166  }
1167  }
1168  // Do the bodyweight stuff
1169  }
1170  double yearlingsvar = (yearlingstotweight2 - ((yearlingstotweight*yearlingstotweight) / double(yearlingssize))) / double(yearlingssize);
1171  double yearlingsmean = yearlingstotweight / double(yearlingssize);
1172  double var = (totweight2 - ((totweight*totweight) / double(size))) / double(size);
1173  double mean = totweight / double(size);
1174  float meanf = (float)mean;
1175  float varf = (float)var;
1176  float meany = (float)yearlingsmean;
1177  float vary = (float)yearlingsvar;
1178  /*
1179  // Lets test the density grid
1180  int den = 0;
1181  for (int i = 0; i < 200; i++)
1182  for (int j = 0; j < 200; j++)
1183  {
1184  for (int l = 0; l < hob_Foobar; l++)
1185  den += m_DensityMap[l][i][j];
1186  }
1187  */
1188  fprintf(POMOut, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%g\t%g\t%g\t%g\t%d\n", (int)m_TheLandscape->SupplyDayInYear(), GetLiveArraySize(hob_Infant), GetLiveArraySize(hob_Young), GetLiveArraySize(hob_Juvenile), GetLiveArraySize(hob_Male), GetLiveArraySize(hob_Female), age0, age1, age2, age3, age4, age5, age6, age7, meanf, varf, meany, vary, m_shot);
1189  fclose(POMOut);
1190  fclose(POMOut2);
1191 }
double GetTotalWeight()
Provide the wet weight of the hare.
Definition: hare_all.h:370

References THare::GetAge(), Population_Manager::GetLiveArraySize(), THare::GetTotalWeight(), hob_Female, hob_Infant, hob_Juvenile, hob_Male, hob_Young, m_shot, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Population_Manager::TheArray, and Landscape::Warn().

Referenced by DoFirst().

◆ SetPolyFood()

void THare_Population_Manager::SetPolyFood ( int  a_poly,
double  a_value 
)
inline

Set polygon food quality.

718 { m_PolyFood[a_poly]=a_value; }

References m_PolyFood.

Referenced by THare::ForageSquare(), and THare::ForageSquareP().

◆ SubtractHareDensity()

void THare_Population_Manager::SubtractHareDensity ( int  x,
int  y,
Hare_Object  a_type 
)
inline

Density function - subtracts one from the density in the square containing by x,y. Each square is 256x256m in size.

646 { m_DensityMap[a_type][x >> __DENSITYSHIFT][y >> __DENSITYSHIFT]--; }

References m_DensityMap.

Referenced by Hare_Juvenile::st_Dispersal().

◆ TheAOROutputProbe()

void THare_Population_Manager::TheAOROutputProbe ( )
virtual

Output method.

Reimplemented from Population_Manager.

1217  {
1219 }
virtual void DoProbe(int a_lifestage)
Definition: AOR_Probe.cpp:59
AOR_Probe * m_AOR_Probe
Definition: PopulationManager.h:526

References AOR_Probe::DoProbe(), hob_Female, and Population_Manager::m_AOR_Probe.

◆ TheRipleysOutputProbe()

void THare_Population_Manager::TheRipleysOutputProbe ( FILE *  a_prb)
protectedvirtual

Standard spatial output.

Special probe for data to be used in spatial statistics

Reimplemented from Population_Manager.

1198  {
1199  // Currently just counts females
1200  Hare_Female* FH;
1201  unsigned totalF= GetLiveArraySize(hob_Female);
1202  int x,y;
1205  fprintf(a_prb,"%d %d %d %d %d\n", 0,w ,0, h, totalF);
1206  for (unsigned j=0; j<totalF; j++) //adult females
1207  {
1208  FH=dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
1209  x=FH->Supply_m_Location_x();
1210  y=FH->Supply_m_Location_y();
1211  fprintf(a_prb,"%d\t%d\n", x,y);
1212  }
1213  fflush(a_prb);
1214 }
int SupplySimAreaHeight(void)
Definition: landscape.h:1637
int SupplySimAreaWidth(void)
Definition: landscape.h:1632

References Population_Manager::GetLiveArraySize(), hob_Female, Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), and Population_Manager::TheArray.

Member Data Documentation

◆ BodyBurdenPrb

FILE* THare_Population_Manager::BodyBurdenPrb
protected

Probe for pestidcide output/testing

Referenced by BodyBurdenOut(), Init(), and ~THare_Population_Manager().

◆ m_AdultMortRate

double THare_Population_Manager::m_AdultMortRate

Input variable - Adult mortality rate.

Referenced by DoFirst(), and THare::WasPredated().

◆ m_DensityMap

int THare_Population_Manager::m_DensityMap[8][200][200]
protected

◆ m_DMWeight

double THare_Population_Manager::m_DMWeight[5001]

Array for storing minimum acceptable size with age.

Referenced by Init().

◆ m_GoodYearBadYear

float THare_Population_Manager::m_GoodYearBadYear

Variable for adding stochasticity.

Referenced by DoFirst().

◆ m_GrowthEfficiency

double THare_Population_Manager::m_GrowthEfficiency[5001]
protected

Precalculated growth efficiency with size

Referenced by GetGrowthEfficiency(), and Init().

◆ m_GrowthEfficiencyF

double THare_Population_Manager::m_GrowthEfficiencyF[5001]
protected

Precalculated growth efficiency for fat with size

Referenced by GetGrowthEfficiencyF(), and Init().

◆ m_GrowthEfficiencyP

double THare_Population_Manager::m_GrowthEfficiencyP[5001]
protected

Precalculated growth efficiency for protein with size

Referenced by GetGrowthEfficiencyP(), and Init().

◆ m_HareThresholdDD

int THare_Population_Manager::m_HareThresholdDD

◆ m_Interference

double THare_Population_Manager::m_Interference[2500]
protected

Array storing density-dependence effect with density

Referenced by GetInterference(), and Init().

◆ m_JuvMortRate

double THare_Population_Manager::m_JuvMortRate

Input variable - Juvenile mortality rate.

Referenced by Hare_Juvenile::BeginStep(), DoFirst(), and Hare_Juvenile::WasPredated().

◆ m_KJperM

double THare_Population_Manager::m_KJperM[7001]
protected

Precalculated cost of locomotion - KJ per m per kg

Referenced by GetKJperM(), and Init().

◆ m_LitterSize

int THare_Population_Manager::m_LitterSize[12][7]
protected

Storage for litter size distributions (not used in default config)

Referenced by CalcLitterSize(), and GetLitterSize().

◆ m_MaxDailyGrowthEnergy

double THare_Population_Manager::m_MaxDailyGrowthEnergy[5001]
protected

Precalculated max growth energy requirement with size

Referenced by GetMaxDailyGrowthEnergy(), and Init().

◆ m_MaxDailyGrowthEnergyF

double THare_Population_Manager::m_MaxDailyGrowthEnergyF[5001]
protected

Precalculated max growth energy requirement with size for fat

Referenced by GetMaxDailyGrowthEnergyF(), and Init().

◆ m_MaxDailyGrowthEnergyP

double THare_Population_Manager::m_MaxDailyGrowthEnergyP[5001]
protected

Precalculated max growth energy requirement with size for protein

Referenced by GetMaxDailyGrowthEnergyP(), and Init().

◆ m_MortStochast

double THare_Population_Manager::m_MortStochast
protected

Stochasticity around mortality parameters

Referenced by DoFirst(), and Init().

◆ m_OurMRRData

MRR_Data* THare_Population_Manager::m_OurMRRData
protected

Data structure for MarkReleaseRecapture expts

Referenced by Init(), MRROutputs(), and ~THare_Population_Manager().

◆ m_PolyFood

double* THare_Population_Manager::m_PolyFood
protected

Temporary storage

Referenced by DoFirst(), GetPolyFood(), Init(), SetPolyFood(), and ~THare_Population_Manager().

◆ m_RefNums

int THare_Population_Manager::m_RefNums
protected

The last hare ID used

Referenced by GetHareRefNum(), and Init().

◆ m_RMR

double THare_Population_Manager::m_RMR[2][366]
protected

Precalculated RMR with age

Referenced by GetRMR(), and Init().

◆ m_shot

int THare_Population_Manager::m_shot
protected

◆ m_variableDD

int THare_Population_Manager::m_variableDD
protected

Used to vary the density dependence each year

Referenced by DoFirst(), and Init().

◆ m_YoungMortRate

double THare_Population_Manager::m_YoungMortRate

Input variable - Young mortality rate.

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), and DoFirst().


The documentation for this class was generated from the following files: